//
//  YD_payCell.m
//  SpeedDating
//
//  Created by isu on 16/12/16.
//  Copyright © 2016年 isu. All rights reserved.
//

#import "YD_payCell.h"

@implementation YD_payCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
+(instancetype)cellWithTableView:(UITableView*)tableView {
    static NSString *ID = @"YD_payCellCell";
    YD_payCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if(cell==nil){
        cell = [[YD_payCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ID ];
        cell.backgroundColor =[UIColor whiteColor];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return cell;
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if(self=[super initWithStyle:style reuseIdentifier:reuseIdentifier]){
        self.imageV = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"weixinchongzhi"]];
        [self.contentView addSubview:self.imageV];
        [self.imageV mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.mas_equalTo(self.contentView);
            make.left.mas_equalTo(15);
            make.size.mas_equalTo(CGSizeMake(25, 25));
        }];
        
        self.payWayLab = [UILabel new];
        [self.contentView addSubview:self.payWayLab];
        [self.payWayLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.mas_equalTo(self.imageV.mas_top).offset(10);
            make.left.mas_equalTo(self.imageV.mas_right);
        }];
        self.payWayLab.text =@"微信支付";
        self.payWayLab.font =[UIFont systemFontOfSize:15.0f];
        
        self.noticeLab = [UILabel new];
        [self.contentView addSubview:self.noticeLab];
        [self.noticeLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.imageV.mas_bottom).offset(-10);
            make.left.mas_equalTo(self.imageV.mas_right);
        }];
        self.noticeLab.text =@"推荐安装微信5.0及以上版本的用户使用";
        self.noticeLab.font =[UIFont systemFontOfSize:12.0f];
        
        self.payBtn =[UIButton new];
        [self.contentView addSubview:self.payBtn];
        [self.payBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.mas_equalTo(self.contentView);
            make.right.mas_equalTo(-20);
            make.size.mas_equalTo(CGSizeMake(25, 25));
        }];
        [self.payBtn setBackgroundImage:[UIImage imageNamed:@"weixuan"] forState:UIControlStateNormal];
        [self.payBtn setBackgroundImage:[UIImage imageNamed:@"Friend_news_selected_button"] forState:UIControlStateSelected];
        
        UIView *lineV= [UIView new];
        [self.contentView addSubview:lineV];
        [lineV mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.bottom.mas_equalTo(self.contentView);
            make.height.mas_equalTo(0.8);
        }];
        lineV.backgroundColor = [UIColor colorWithWhite:0.902 alpha:1.000];

        
    }
    return  self;
}
@end
